home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
0669.ZIP
/
SETPASS.PRG
< prev
next >
Wrap
Text File
|
1985-12-30
|
2KB
|
86 lines
* PROGRAM NAME.....SETPASS.PRG
* AUTHOR...........MIKE COTICCHIO
* NOTES............This program is used to initialize username
* and passwords. The password can be encrypted,
* if desired.
use logon index logon
store 'N' to answer
**** The following loop checks username to make sure it is unique ****
do while answer <> 'Y'
clear
store space(15) to username
store space(1) to answer
@ 5,5 say "Username (maximum of 15 letters): ";
get username picture '@!'
read
**** If user wants to bail out of program, a carriage return in ****
**** response to the prompt will allow it ****
if asc(username) = 32
clear
close database
return
endif
find &username
if .not. eof()
? chr(7)
@ 10,5 say trim(username)+ ' already exists. Select another.'
?
?
wait
loop
endif
@ 10,5 say trim(username)+', is that correct? ' get answer picture
'@!'
read
enddo
@ 10,0 clear
store .f. to passmatch
**** Loop to accept and verify password ****
do while .not. passmatch
@ 10,5 say "Enter password (maximum of 10 letters): "
**** Set color to 0/0 blanks screen so that input cannot be read ****
set color to 0/0
accept to password1
**** Set color back to normal - change value as desired ****
set color to 3/0
@ 12,5 say "Re-enter password: "
set color to 0/0
accept to password2
set color to 3/0
if upper(password1) = upper(password2)
store .t. to passmatch
else
@ 10,0 clear
? chr(7)
Wait "Passwords don't match - strike any key to try again!"
@ 10,0 clear
endif
enddo
store upper(password1) to password1
**** The encryption routine is called here. If encryption not ****
**** needed this section should be deleted ****
store space(10) to encrypted
@ 10,0 clear
@ 10,5 say "Encrypting password..."
do encrypt with password1,encrypted
store encrypted to password1
**** End of call to encryption routine ****
append blank
replace name with username, password with password1
clear
return